<%@page import="com.kaola.pojo.UserProduct"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="shortcut icon" href="../icon/favicon2.ico" />
<meta charset="UTF-8">
<title>购物车-网易考拉海购</title>
<link rel="stylesheet" href="../css/shoppingcart.css" />
<script type="text/javascript"
	src="../js/jquery-1.11.3/jquery-1.11.3.js"></script>
<script type="text/javascript" src="../js/shoppingcart.js"></script>
<script type="text/javascript">
	function updateBuyNum(self) {
		$(self).parents("form").submit();
	}

	function reduceBuyNum(self) {
		var oldVal = $(self).next().val();
		$(self).next().val(--oldVal);
		updateBuyNum($(self).next());
	}

	function addBuyNum(self) {
		var oldVal = $(self).prev().val();
		$(self).prev().val(++oldVal);
		updateBuyNum($(self).prev());
	}
</script>
</head>

<body>
	<nav id="topNav">
	<div id="topNavWrap" class="clearfix">
		<div id="topNavLeft">
			考拉欢迎你！<span>${user.account}</span>
			<%
				if (session.getAttribute("user") == null) {
			%>
			<a class="login" href="/kaola/users/login" data-param="zn=top">登录</a>
			<span class="sep">|</span> <a target="_blank"
				href="/kaola/users/register" data-param="zn=top">免费注册</a>
			<%
				}
			%>
			<%
				if (session.getAttribute("user") != null) {
			%>
			<a href="/kaola/users/quit" data-param="zn=top">退出</a>
			<%
				}
			%>
		</div>
		<div id="topNavLeft2">
			<a class="app" href="#" rel="nofollow"
				data-param="from=topDownload&zn=top"> <i class="iconfont icn"
				style="top: -1px;"> <svg class="icon"
						style="width: 0.7em; height: 0.7em;vertical-align: middle;fill: currentColor;overflow: hidden;"
						viewBox="0 0 1024 1024" version="1.1"
						xmlns="http://www.w3.org/2000/svg" p-id="1047"> <path
						d="M725.430462 66.992787 303.093575 66.992787c-49.978275 0-90.51348 41.10621-90.51348 91.813079l0 703.679577c0 50.706869 40.535205 91.778286 90.51348 91.778286l422.336888 0c49.978275 0 90.493014-41.072441 90.493014-91.778286L815.923476 158.804842C815.923476 108.098997 775.408737 66.992787 725.430462 66.992787zM393.588635 143.520741c0-8.458649 6.756891-15.319917 15.074324-15.319917l211.178677 0c8.352225 0 15.074324 6.861268 15.074324 15.319917l0 30.601972c0 8.422833-6.722098 15.284101-15.074324 15.284101L408.662959 189.406814c-8.318456 0-15.074324-6.861268-15.074324-15.284101L393.588635 143.520741zM514.251785 893.089461c-33.322943 0-60.322877-27.382651-60.322877-61.20906 0-33.755802 26.998911-61.170175 60.322877-61.170175 33.326013 0 60.343343 27.414373 60.343343 61.170175C574.595129 865.706811 547.577798 893.089461 514.251785 893.089461zM725.430462 740.104161 303.093575 740.104161 303.093575 219.97604l422.336888 0L725.430462 740.104161z"
						p-id="527"></path> </svg> </i> 手机考拉海购 <span class="m-notice"> <img
					src="../images/home/2dcode-app3.jpg" width="58px" height="58px" />
					<strong class="txt"> 下载APP <br /> 领1000元新人礼包 </strong> </span> </a>
		</div>
		<ul id="topNavRight">
			<li><a href="#" class="toplevel newnav checkin" rel="nofollow">
					<i class="iconfont icn"> <svg class="icon"
							style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
							viewBox="0 0 1024 1024" version="1.1"
							xmlns="http://www.w3.org/2000/svg" p-id="1942"> <path
							d="M875.422 751.11c-8.16-11.977-15.303-22.602-22.604-33.12-53.561-77.071-126.022-116.132-221.289-108.050-65.161 5.526-130.226 12.33-195.382 18.021-88.825 7.755-166.607-11.949-221.39-95.074-15.826 46.423-30.596 88.447-44.487 130.754-30.959 94.276-61.379 188.731-92.228 283.045-8.963 27.404-20.201 37.221-35.652 32.479-16.635-5.113-18.82-18.422-8.933-48.185 97.71-294.214 195.311-588.458 293.023-882.661 2.268-6.833 4.619-13.919 8.522-19.849 5.792-8.819 15.129-11.586 24.996-8.122 9.631 3.387 15.605 10.649 15.252 21.443-0.141 4.26-1.148 8.572-2.337 12.695-10.614 36.665-10.909 37.008 21.281 58.946 44.193 30.121 95.025 35.237 146.252 34.063 66.301-1.517 130.989-19.371 197.177-22.739 84.586-4.308 160.396 14.784 216.627 84.085 8.481 10.455 10.943 19.782 8.634 33.463-27.222 161.348-53.595 322.839-80.063 484.314-1.26 7.687-1.523 15.514-7.399 24.495z"
							p-id="1943"></path> </svg> </i> 每日签到 </a> <span class="sep">|</span></li>
			<li><a class="toplevel" href="#" rel="nofollow"
				data-param="zn=top">我的订单</a> <span class="sep">|</span></li>
			<li class="dropmenu personal" id="j-dropmenuPersonal">
				<div class="mcDropMenuBox">
					<a class="toplevel topNavHolder" href="#" rel="nofollow"
						data-param="zn=top"> 个人中心 <i class="arr"></i> </a> <span
						class="sep">|</span>
					<div class="mcDropMenu">
						<a href="#" rel="nofollow" data-param="zn=top"> <span
							class="cnt">我的优惠券</span> </a> <a href="#" rel="nofollow"
							data-param="zn=top"> <span class="cnt">我的考拉豆</span> </a> <span
							class="spliter"></span> <a href="#" rel="nofollow"
							data-param="zn=top"> <span class="cnt">账户安全</span> </a> <a
							href="#" rel="nofollow" data-param="zn=top"> <span
							class="cnt">我的实名认证</span> </a> <span class="spliter"></span> <a
							href="#" rel="nofollow" data-param="zn=top"> <span
							class="cnt">我收藏的商品</span> </a> <a href="#" rel="nofollow"
							data-param="zn=top"> <span class="cnt">我关注的品牌</span> </a> <span
							class="spliter"></span> <a href="#" rel="nofollow"
							data-param="zn=top"> <span class="cnt">售后管理</span> </a>
					</div>
				</div></li>
			<li class="dropmenu service">
				<div class="mcDropMenuBox">
					<a class="toplevel topNavHolder nolink" href="#" rel="nofollow">
						客户服务 <i class="arr"></i> </a> <span class="sep">|</span>
					<div class="mcDropMenu">
						<a class="contact j-openService" rel="nofollow"
							data-category="联系客服" data-event="顶部通栏点击数" data-label> <i
							class="w-icon w-icon-contact"></i> 联系客服 </a> <a class="help" href="#"
							rel="nofollow" data-param="zn=top"> <i
							class="w-icon w-icon-help">&nbsp;</i> 帮助中心 </a>
					</div>
				</div></li>
			<li class="dropmenu recharge">
				<div class="mcDropMenuBox">
					<a class="toplevel topNavHolder nolink" href="#" rel="nofollow">
						充值中心 <i class="arr"></i> </a> <span class="sep">|</span>
					<div class="mcDropMenu">
						<a href="#" rel="nofollow" data-param="zn=top">话费充值</a> <a
							id="gameRecharge" href="#" rel="nofollow" data-param="zn=top">游戏充值</a>
					</div>
				</div></li>
			<li class="cinform"><a class="toplevel" id="customerInform"
				href="#" rel="nofollow" data-param="zn=top">消费者告知书</a> <span
				class="sep">|</span></li>
			<li class="dropmenu more">
				<div class="mcDropMenuBox focuson">
					<a class="toplevel topNavHolder nolink" href="#" rel="nofollow">
						更多 <i class="arr"></i> </a>
					<div class="mcDropMenu">
						<a id="addFavBtn" href="#" rel="nofollow">收藏本站</a> <a
							class="wb clearfix" href="http://weibo.com/u/5448480859"
							target="_blank" rel="nofollow"> <span class="txt">新浪微博</span>
							<span class="m-notice m-notice-1"> <img
								src="../images/home/2dcode-wb.jpg" width="100px" height="100px" />
						</span> </a> <a class="nolink clearfix" href="#" rel="nofollow"> <span
							class="txt">微信公众号</span> <span class="m-notice"> <img
								src="../images/home/2dcode-wx.jpg" width="100px" height="100px" />
						</span> </a> <a class="yixin nolink clearfix" href="#" rel="nofollow"> <span
							class="txt">易信公众号</span> <span class="m-notice m-notice-2">
								<img src="../images/home/2dcode-yx.jpg" width="100px"
								height="100px" /> </span> </a> <a class="cooperation" href="#"
							rel="nofollow" data-param="zn=top">招商合作</a> <a class="richjob"
							href="#" rel="nofollow" data-param="zn=top">考拉招聘</a>
					</div>
				</div></li>
		</ul>
	</div>
	</nav>
	<header id="docHead" class="j-indexTopFixed">
	<div id="docHeadWrap">
		<a href="/kaola" class="logokaola" title="网易考拉海购" data-param="zn=top"></a>
	</div>
	</header>
	<article class="mainWrap orderMain">
	<div id="cartbox">
		<div class="m-cartbox">
			<div class="head f-cb">
				<div class="col col2">商品信息</div>
				<div class="col col3">单价(元)</div>
				<div class="col col4">数量</div>
				<div class="col col5">金额(元)</div>
				<div class="col col6">操作</div>
			</div>
			<div class="m-cart">
				<s:iterator value="userProducts" var="up">
					<form method="post" action="/kaola/userproducts/update">
						<div class="goods">
							<ul class="m-goods">
								<li class="gooditm z-selected">
									<div class="col col2">
										<div class="txtwrap">
											<h3 class="goodtlt">
												<a href="#" title="${up.product.name}">${up.product.name}</a>
											</h3>
										</div>
									</div>
									<div class="col col3">
										<span class="newprice">${up.product.price}</span>
									</div>
									<div class="col col4">
										<span class="u-setcount"> <span class="minus" onclick="reduceBuyNum(this)"> <svg
													class="icon"
													style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
													viewBox="0 0 1024 1024" version="1.1"
													xmlns="http://www.w3.org/2000/svg" p-id="2668"> <path d="M182.864 493.795h656.816v36.409h-656.816v-36.409z" p-id="2377"></path> </svg> </span> <input type="number" class="ipt" min="1" autocomplete="off"
											name="userProduct.buyNum" onchange="updateBuyNum(this)"
											value="${up.buyNum}" data-value="1" max="1"> <span class="plus" onclick="addBuyNum(this)"> <svg
													class="icon"
													style="width: 1em; height: 1em;vertical-align: middle;fill: currentColor;overflow: hidden;"
													viewBox="0 0 1024 1024" version="1.1"
													xmlns="http://www.w3.org/2000/svg" p-id="1813"> <path d="M185.89696 532.2752l286.72 0 0 286.72c0 11.32544 9.17504 20.48 20.48 20.48s20.48-9.15456 20.48-20.48l0-286.72 286.72 0c11.30496 0 20.48-9.15456 20.48-20.48s-9.17504-20.48-20.48-20.48l-286.72 0 0-286.72c0-11.32544-9.17504-20.48-20.48-20.48s-20.48 9.15456-20.48 20.48l0 286.72-286.72 0c-11.30496 0-20.48 9.15456-20.48 20.48S174.592 532.2752 185.89696 532.2752z" p-id="1814"></path> </svg> </span> </span>
									</div>
									<div class="col col5">
										<span class="sum sumrow">
										<% 
											UserProduct userProduct = (UserProduct) request.getAttribute("up");
											int buyNum = userProduct.getBuyNum();
											double price = userProduct.getProduct().getPrice();
											out.print(buyNum * price);
										%>
										</span>
									</div>
									<div class="col col6">
										<input type="hidden" name="userProduct.id" value="${up.id}" />
										<input type="hidden" name="userProduct.user.id"
											value="${up.user.id}" /> <input type="hidden"
											name="userProduct.product.id" value="${up.product.id}" /> <input
											type="hidden" name="userProduct.createAt"
											value="${up.createAt}" /> <input type="hidden"
											name="userProduct.version" value="${up.version}" /> <a
											class="u-opt"
											href="/kaola/userproducts/destroy?userProduct.id=${up.id}&userProduct.user.id=${user.id}">删除</a>
									</div></li>
							</ul>
						</div>
					</form>
				</s:iterator>
			</div>
			<div class="totalbox">
				<div class="m-total f-cb" id="totalbar" style="width: 1088px;">
					<div class="ttbar">
						<div class="rt">
							<a class="gobuy ">去结算</a>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</article>
	<footer id="docFoot">
	<div id="aboutNEST">
		<a
			href="http://ir.netease.com/phoenix.zhtml?c=122303&amp;p=irol-IRHome"
			rel="nofollow" target="_blank" title="About NetEase">About
			NetEase</a> <span class="sep">|</span> <a
			href="http://gb.corp.163.com/gb/about/overview.html" rel="nofollow"
			target="_blank" title="公司简介">公司简介</a> <span class="sep">|</span> <a
			href="http://gb.corp.163.com/gb/contactus.html" rel="nofollow"
			target="_blank" title="联系方法">联系方法</a> <span class="sep">|</span> <a
			href="https://www.kaola.com/footer/friendlylink.shtml"
			target="_blank" title="友情链接" data-param="zn=footer">友情链接</a> <span
			class="sep">|</span> <a href="http://hr.163.com/" rel="nofollow"
			target="_blank" title="招聘信息">招聘信息</a> <span class="sep">|</span> <a
			href="http://help.163.com/" rel="nofollow" target="_blank"
			title="客户服务">客户服务</a> <span class="sep">|</span> <a
			href="http://gb.corp.163.com/gb/legal.html" rel="nofollow"
			target="_blank" title="隐私政策">隐私政策</a> <span class="sep">|</span> <a
			href="http://emarketing.163.com/" rel="nofollow" target="_blank"
			title="网络营销">网络营销</a> <span class="sep">|</span> <a
			href="https://www.kaola.com/footer/sitemap.shtml" target="_blank"
			title="网站地图" data-param="zn=footer">网站地图</a> <span class="sep">|</span>
		<a href="https://www.kaola.com/" target="_blank" title="网易考拉海购"
			data-param="zn=footer">网易考拉海购</a> <br> <span class="m-license">网络文化经营许可证：浙网文[2016]0155-055号</span>
		<span class="m-license">增值电信业务经营许可证：浙B2-20090185-3</span> <span
			class="m-license">出版物经营许可证：新出发浙杭经零字第00136号</span> <span
			class="m-license">食品经营许可证：JY13301860112412</span> <br> <a
			target="_blank"
			href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010002000066">
			<img src="../images/login/f28aa8ee818a42bf832341f605eccefb.png">
		</a> <a target="_blank"
			href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33010002000066">
			<span style="margin: 0px 0px 0px 5px;">浙公网安备 33010002000066号</span> </a>
		<span class="m-license">网易公司版权所有©1997-2017</span>
		<div class="f-tac">
			<span id="KXYZ"> <a
				href="https://ss.knet.cn/verifyseal.dll?sn=e15040881010058239iy2f000000&amp;ct=df&amp;a=1&amp;pa=20160215"
				id="kx_verify" tabindex="-1" target="_blank" kx_type="图标式"
				style="display:inline-block;"> <img
					src="../images/login/d720d83b55a04b6f932ea845c673c5bf.png"
					alt="可信网站"> </a> </span> <a class="u-shield"
				href="http://idinfo.zjaic.gov.cn/bscx.do?method=hddoc&amp;id=33010800002332"
				target="_blank"> <img
				src="../images/login/a1c44d335d4c4abd9b3db5977f4d6bd9.gif"
				alt="工商营业执照网上标识"> </a>
		</div>
	</div>
	</footer>
</body>
</html>
